package br.server;

import java.rmi.RemoteException;
import java.rmi.server.UnicastRemoteObject;

import br.common.Calculadora;
import br.common.remoteobjects.ObjExpressao;
import br.server.remoteobjects.Expressao;

public class CalculadoraImpl extends UnicastRemoteObject implements Calculadora {

	public CalculadoraImpl() throws RemoteException {
	}
	
	@Override
	public int multiplica(int a, int b) throws RemoteException {
		System.out.println("Servidor metodo multiplica");
		System.out.println("a = " + a + " b = " + b);
		System.out.println("resultado: " + a*b);
		return a*b;
	}

	@Override
	public ObjExpressao somaExpressao(int a, int b) throws RemoteException {
		System.out.println("Servidor metodo soma");
		System.out.println("a = " + a + " b = " + b);
		System.out.println("resultado: " + (a+b));
		Expressao exp = new Expressao("a+b",a+b);
		return exp;
	}

}
